home *** CD-ROM | disk | FTP | other *** search
- /***
- * BASIC.CH Copyright (c) BITwise Computer Services, 1992
- *
- * - Basic enhancements to Clipper command set
- */
-
-
- // ALWAYS INCLUDE KEYBOARD DEFINITIONS
- #include "inkey.ch"
- #include "dbfntx.ch"
-
- // ADDITIONAL KEYBOARD DEFINITIONS
- #define K_MLEFT -100 // LEFT MOUSE BUTTON
- #define K_MRIGHT -200 // RIGHT MOUSE BUTTON
- #define K_EXCEPTION -300 // KEYBOARD EXCEPTION
- #define K_TIMEOUT -400 // P_INKEY() TIMEOUT
- #define K_SPACE 32 // Spacebar
- #define K_CTRL_UP 397 // Ctrl-Up
- #define K_CTRL_DOWN 401 // Ctrl-Down
- #define K_CTRL_ENTER 10 // Ctrl-Enter
- #define K_PLUS 43 // <+>
- #define K_MINUS 45 // <->
-
- // ADDITIONAL GET EXITSTATE DEFINITIONS
- #define GE_TIMEOUT 20
- #define READBUTTONS "<CTRL-ƒŸ=Save> <ESC=Abort>"
- #define DIALOGBUTTONS "<CTRL-ƒŸ=OK> <ESC=Abort>"
-
- // MSGBOX DEFINES
- #define OK 1
- #define WAIT 2
- #define NONE 0
- #define ERROR 1
- #define ATTN 2
- #define SUCCESS 3
-
-
- /****
- * Modified Standard Commands
- */
-
- #command SEEK <xpr> ALIAS <a> => <a> -> ( dbSeek(<xpr>) )
-
- #command SEEK <xpr> IN <a> => <a> -> ( dbSeek(<xpr>) )
-
- #command SET INDEX TO <(file)> ADDITIVE => dbSetIndex( <(file)> )
-
- // DBFNTX Ver 2.0 ONLY!!!
- #command INDEX ON <key> TO <(file)> PROGRESS ;
- [MESSAGE <msg>] ;
- [FOR <for>] ;
- [<all:ALL>] ;
- [WHILE <while>] ;
- [NEXT <next>] ;
- [RECORD <rec>] ;
- [<rest:REST>] ;
- [<unique: UNIQUE>] ;
- [<ascend: ASCENDING>] ;
- [<descend: DESCENDING>] ;
- ;
- => P_PROGWIN(<msg>) ;
- ; P_PROGINIT(RECCOUNT()) ;
- ; _dtxCondSet( <"for">, <{for}>, ;
- if( <.all.>, .t., NIL ), ;
- <{while}>, ;
- {|| P_PROGRESS(RECNO())}, LASTREC()/20, ;
- RECNO(), <next>, <rec>, ;
- if( <.rest.>, .t., NIL ), ;
- if( (<.descend.> .AND. !<.ascend.>), .t., NIL )) ;
- ; dbCreateIndex(<(file)>, <"key">, <{key}>, ;
- if( <.unique.>, .t., NIL )) ;
- ; P_PROGRESS(RECCOUNT()) ;
- ; P_POPWIN()
-
-
- /****
- * Additional "Standard" Commands
- */
-
- // "COMPILES" A CHARACTER STRING EXPRESSION INTO A CODEBLOCK
- #define COMPILE(exp) &("{|| "+exp+"}")
-
- // ASSIGN DEFAULT VALUES TO NIL PARAMETERS OR VARIABLES
- #command DEFAULT <p> TO <val> [,<pn> TO <valn>] => ;
- <p>:=IF(<p> == NIL,<val>,<p>) ;
- [; <pn>:=IF(<pn> == NIL,<valn>,<pn>)]
-
-
- //EOF
-